Fix a warning.
authorMatthias Clasen <matthiasc@src.gnome.org>
Mon, 3 Apr 2006 15:50:30 +0000 (15:50 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 3 Apr 2006 15:50:30 +0000 (15:50 +0000)
* gtk/gtktextlayout.c: Fix a warning.

* gtk/gtktextsegment.h:
* gtk/gtktextsegment.c:
* gtk/gtktextchild.c:
* gtk/gtktextbtree.c:
* gtk/gtktextmark.c:
* gtk/gtktexttypes.h: Make the segment class pointers const.

* gtk/gtktextbufferserialize.c: Make parser struct const.

* gtk/gtkuimanager.c: Make parser struct const.

ChangeLog
ChangeLog.pre-2-10
gtk/gtktextbtree.c
gtk/gtktextbufferserialize.c
gtk/gtktextchild.c
gtk/gtktextlayout.c
gtk/gtktextmark.c
gtk/gtktextsegment.c
gtk/gtktextsegment.h
gtk/gtktexttypes.h
gtk/gtkuimanager.c

index 73c4f3bf9feaa51dedc96a2ccd9eeae7e2181fa0..8c156cca0459bd97636e517fe58bf8e0e7f6fedb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2006-04-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextlayout.c: Fix a warning.
+       
+       * gtk/gtktextsegment.h: 
+       * gtk/gtktextsegment.c: 
+       * gtk/gtktextmark.c: 
+       * gtk/gtktexttypes.h: Make the segment class pointers const.
+
+       * gtk/gtktextbufferserialize.c: Make parser struct const.
+       
+       * gtk/gtkuimanager.c: Make parser struct const.
+
        * gtk/gtklinkbutton.c: Make the default colors const.
 
        * gtk/gtkuimanager.c: Avoid relocations. 
index 73c4f3bf9feaa51dedc96a2ccd9eeae7e2181fa0..8c156cca0459bd97636e517fe58bf8e0e7f6fedb 100644 (file)
@@ -1,5 +1,16 @@
 2006-04-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextlayout.c: Fix a warning.
+       
+       * gtk/gtktextsegment.h: 
+       * gtk/gtktextsegment.c: 
+       * gtk/gtktextmark.c: 
+       * gtk/gtktexttypes.h: Make the segment class pointers const.
+
+       * gtk/gtktextbufferserialize.c: Make parser struct const.
+       
+       * gtk/gtkuimanager.c: Make parser struct const.
+
        * gtk/gtklinkbutton.c: Make the default colors const.
 
        * gtk/gtkuimanager.c: Avoid relocations. 
index 1269256256ab41080fec4490a3010e030667f6a5..1216d1834bdcc6132642305f24589c1618978c71 100644 (file)
@@ -6923,7 +6923,7 @@ _gtk_text_btree_check (GtkTextBTree *tree)
             }
           else
             {
-              GtkTextLineSegmentClass * last = NULL;
+              const GtkTextLineSegmentClass *last = NULL;
 
               for (line = node->children.line ; line != NULL ;
                    line = line->next)
index 4a869d5c9957f1cbde8069087266ce3a6cf50aa0..f8cb1fe5f4a5bd41b2a79fa950f407e2a27761c8 100644 (file)
@@ -1798,8 +1798,7 @@ deserialize_text (GtkTextBuffer *buffer,
   ParseInfo info;
   gboolean retval = FALSE;
 
-
-  static GMarkupParser rich_text_parser = {
+  static const GMarkupParser rich_text_parser = {
     start_element_handler,
     end_element_handler,
     text_handler,
index 05a1a3c7e32dd539b3bee70b75b944f51c018935..5fd0d721083662d6bb9b4e81c3c6180645fd81f4 100644 (file)
@@ -108,7 +108,7 @@ pixbuf_segment_check_func (GtkTextLineSegment *seg,
 }
 
 
-GtkTextLineSegmentClass gtk_text_pixbuf_type = {
+const GtkTextLineSegmentClass gtk_text_pixbuf_type = {
   "pixbuf",                          /* name */
   FALSE,                                            /* leftGravity */
   NULL,                                          /* splitFunc */
@@ -206,7 +206,7 @@ child_segment_check_func (GtkTextLineSegment *seg,
     g_error ("child segment has char count of %d", seg->char_count);
 }
 
-GtkTextLineSegmentClass gtk_text_child_type = {
+const GtkTextLineSegmentClass gtk_text_child_type = {
   "child-widget",                                        /* name */
   FALSE,                                                 /* leftGravity */
   NULL,                                                  /* splitFunc */
index b46d1685bad1c460da1a9893cdc33401d876c163..85ff8966e2b972157b91ee4a860e5348b55c3e7d 100644 (file)
@@ -1293,7 +1293,6 @@ set_para_values (GtkTextLayout      *layout,
       pango_layout_set_width (display->layout, layout_width * PANGO_SCALE);
       pango_layout_set_wrap (display->layout, PANGO_WRAP_CHAR);
       break;
-
     case GTK_WRAP_WORD:
       layout_width = layout->screen_width - display->left_margin - display->right_margin;
       pango_layout_set_width (display->layout, layout_width * PANGO_SCALE);
@@ -1329,14 +1328,14 @@ gtk_text_attr_appearance_copy (const PangoAttribute *attr)
 static void
 gtk_text_attr_appearance_destroy (PangoAttribute *attr)
 {
-  GtkTextAppearance *appearance = &((GtkTextAttrAppearance *)attr)->appearance;
+  GtkTextAttrAppearance *appearance_attr = (GtkTextAttrAppearance *)attr;
 
-  if (appearance->bg_stipple)
-    g_object_unref (appearance->bg_stipple);
-  if (appearance->fg_stipple)
-    g_object_unref (appearance->fg_stipple);
+  if (appearance_attr->appearance.bg_stipple)
+    g_object_unref (appearance_attr->appearance.bg_stipple);
+  if (appearance_attr->appearance.fg_stipple)
+    g_object_unref (appearance_attr->appearance.fg_stipple);
 
-  g_slice_free (GtkTextAttrAppearance, attr);
+  g_slice_free (GtkTextAttrAppearance, appearance_attr);
 }
 
 static gboolean
index 260cc44d1d1c29e77c4cb4085186c9034b0c30bd..4961b8d50b84f40fb33995cd45640f67577189b7 100644 (file)
@@ -291,7 +291,7 @@ static void                mark_segment_check_func   (GtkTextLineSegment *segPtr
  * their gravity property.
  */
 
-GtkTextLineSegmentClass gtk_text_right_mark_type = {
+const GtkTextLineSegmentClass gtk_text_right_mark_type = {
   "mark",                                               /* name */
   FALSE,                                                /* leftGravity */
   NULL,                                         /* splitFunc */
@@ -301,7 +301,7 @@ GtkTextLineSegmentClass gtk_text_right_mark_type = {
   mark_segment_check_func                               /* checkFunc */
 };
 
-GtkTextLineSegmentClass gtk_text_left_mark_type = {
+const GtkTextLineSegmentClass gtk_text_left_mark_type = {
   "mark",                                               /* name */
   TRUE,                                         /* leftGravity */
   NULL,                                         /* splitFunc */
index 3b961ad66bfdade7d4c04e6b608a67ca87f644c6..71c4e16dd8145900b919ac913e11a0c74c6730b3 100644 (file)
@@ -196,7 +196,7 @@ _gtk_char_segment_new (const gchar *text, guint len)
   g_assert (gtk_text_byte_begins_utf8_char (text));
 
   seg = g_malloc (CSEG_SIZE (len));
-  seg->type = &gtk_text_char_type;
+  seg->type = (GtkTextLineSegmentClass *)&gtk_text_char_type;
   seg->next = NULL;
   seg->byte_count = len;
   memcpy (seg->body.chars, text, len);
@@ -590,7 +590,7 @@ toggle_segment_line_change_func (segPtr, line)
  */
 
 
-GtkTextLineSegmentClass gtk_text_char_type = {
+const GtkTextLineSegmentClass gtk_text_char_type = {
   "character",                          /* name */
   0,                                            /* leftGravity */
   char_segment_split_func,                              /* splitFunc */
@@ -605,7 +605,7 @@ GtkTextLineSegmentClass gtk_text_char_type = {
  * range:
  */
 
-GtkTextLineSegmentClass gtk_text_toggle_on_type = {
+const GtkTextLineSegmentClass gtk_text_toggle_on_type = {
   "toggleOn",                                   /* name */
   0,                                            /* leftGravity */
   NULL,                 /* splitFunc */
@@ -620,7 +620,7 @@ GtkTextLineSegmentClass gtk_text_toggle_on_type = {
  * range:
  */
 
-GtkTextLineSegmentClass gtk_text_toggle_off_type = {
+const GtkTextLineSegmentClass gtk_text_toggle_off_type = {
   "toggleOff",                          /* name */
   1,                                            /* leftGravity */
   NULL,                 /* splitFunc */
index 691147b08ccd309378d807e0861198433b023e0d..394703b9d4d528b53fd2b1bf9ff990f0b9e92566 100644 (file)
@@ -131,10 +131,10 @@ struct _GtkTextLineSegmentClass {
  */
 
 struct _GtkTextLineSegment {
-  GtkTextLineSegmentClass *type;                /* Pointer to record describing
-                                                 * segment's type. */
-  GtkTextLineSegment *next;                /* Next in list of segments for this
-                                            * line, or NULL for end of list. */
+  const GtkTextLineSegmentClass *type;  /* Pointer to record describing
+                                         * segment's type. */
+  GtkTextLineSegment *next;             /* Next in list of segments for this
+                                         * line, or NULL for end of list. */
 
   int char_count;                       /* # of chars of index space occupied */
 
index 635f6e0f50eb321bc2fd6e5d25ae0305f97cdb66..3324ec9edcc054439c830ad6d504373f4e01f5b9 100644 (file)
@@ -55,17 +55,17 @@ typedef struct _GtkTextMarkBody GtkTextMarkBody;
 #endif
 
 /* In gtktextbtree.c */
-extern GtkTextLineSegmentClass gtk_text_char_type;
-extern GtkTextLineSegmentClass gtk_text_toggle_on_type;
-extern GtkTextLineSegmentClass gtk_text_toggle_off_type;
+extern const GtkTextLineSegmentClass gtk_text_char_type;
+extern const GtkTextLineSegmentClass gtk_text_toggle_on_type;
+extern const GtkTextLineSegmentClass gtk_text_toggle_off_type;
 
 /* In gtktextmark.c */
-extern GtkTextLineSegmentClass gtk_text_left_mark_type;
-extern GtkTextLineSegmentClass gtk_text_right_mark_type;
+extern const GtkTextLineSegmentClass gtk_text_left_mark_type;
+extern const GtkTextLineSegmentClass gtk_text_right_mark_type;
 
 /* In gtktextchild.c */
-extern GtkTextLineSegmentClass gtk_text_pixbuf_type;
-extern GtkTextLineSegmentClass gtk_text_child_type;
+extern const GtkTextLineSegmentClass gtk_text_pixbuf_type;
+extern const GtkTextLineSegmentClass gtk_text_child_type;
 
 /*
  * UTF 8 Stubs
index 4ed119624c2a9249688084180b43d34aa1d99d82..f7fa90b7f0200a297c6fe47e219e0f2b153013b5 100644 (file)
@@ -1467,7 +1467,7 @@ text_handler (GMarkupParseContext *context,
 }
 
 
-static GMarkupParser ui_parser = {
+static const GMarkupParser ui_parser = {
   start_element_handler,
   end_element_handler,
   text_handler,